﻿
// 2018/6/20: 首个记录
// 2018/12/29: 改pragma once
// 2019/3/29: 添加注释
// 2019/10/11: 修改include
// 2020/1/13: 接口完备性
// 2020/5/15: 修正fromGeneralSample
// 2020/11/12: 支持Spadas7
// 2022/11/2: 支持Spadas8.4
// 2024/6/13: 基于新样本框架

#ifndef MAN_TRIGGER_SAMPLE_V1_H
#define MAN_TRIGGER_SAMPLE_V1_H

#include "spadas.h"

namespace man_trigger_sample_v1
{
	using namespace spadas;

	struct ManTriggerSampleData
	{
		Bool triggers[16]; // 16路手动触发器是否激活

		ManTriggerSampleData()
		{
			for (UInt i = 0; i < 16; i++) triggers[i] = FALSE;
		}
	};

	class ManTriggerSample : public Object<class ManTriggerSampleVars>
	{
	public:
		SPADAS_TYPE("man_trigger_sample_v1.ManTriggerSample")

		ManTriggerSample();
		FullTimestamp& timestamp();
		ManTriggerSampleData *operator ->();

		static String getProtocolName();
		SessionGeneralSample toGeneralSample();

		static Array<String> getProtocolNames();
		Bool fromGeneralSample(String protocol, SessionGeneralSample generalSample);
	};
}

#endif
